{
 "cells": [
  {
   "cell_type": "code",
<<<<<<< HEAD
   "execution_count": 2,
=======
   "execution_count": 8,
>>>>>>> 3f4c287f35bd60b69f4fac644daa30e5913c543b
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import brnn_model\n",
    "import sys  \n",
    "import import_folders\n",
    "%matplotlib inline\n",
    "import pickle_lib as pkl\n",
    "import utilities_lib as ul\n",
    "from graph_lib import gl\n",
    "import numpy as np\n",
    "## Load the data once !!\n",
    "import mpmath as mpm\n",
    "# Import specific model libraries\n",
    "from sklearn.gaussian_process import GaussianProcessRegressor\n",
    "from sklearn.gaussian_process.kernels import RBF, ConstantKernel as C, WhiteKernel, ExpSineSquared\n",
    "from sklearn import preprocessing\n",
    "from scipy import spatial\n",
    "from matplotlib import pyplot as plt\n",
    "from matplotlib import cm as cm\n",
    "\n",
    "\n",
    "plt.close(\"all\") # Close all previous Windows"
   ]
  },
  {
   "cell_type": "code",
<<<<<<< HEAD
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
=======
   "execution_count": 10,
   "metadata": {},
>>>>>>> 3f4c287f35bd60b69f4fac644daa30e5913c543b
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "------------- First chain Example-----------------\n",
      "X\n",
      "[[-1.08627296 -1.2749806  -1.41443153 -1.48945936 -1.49901393 -1.45452455\n",
      "  -1.37206886 -1.26367426 -1.13445272 -0.98784455 -0.83524372 -0.70151426\n",
      "  -0.61917785 -0.61258824 -0.6795667  -0.78312521 -0.86028229 -0.84584949\n",
      "  -0.7003797  -0.42819099]]\n",
      "Y\n",
      "[[-1. -1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1. -1. -1.  1.  1.\n",
      "   1.  1.]]\n",
      "Number of steps: 50\n",
      "Number of chains: 300\n",
      "['Shape of the concatenated data:', (15000, 1)]\n"
     ]
    }
   ],
   "source": [
    "\n",
    "########## Loading Data ###############\n",
    "\n",
    "Ndivisions = 10;\n",
    "folder_data = \"./artificial_data/\"\n",
    "## Test to load the files back \n",
    "X_list = pkl.load_pickle(folder_data +\"X_values.pkl\",Ndivisions)\n",
    "Y_list = pkl.load_pickle(folder_data +\"Y_values.pkl\",Ndivisions)\n",
    "\n",
    "print (\"------------- First chain Example-----------------\")\n",
    "print (\"X\")\n",
    "print (X_list[0][:20].T)\n",
    "print (\"Y\")\n",
    "print (Y_list[0][:20].T)\n",
    "\n",
    "N_steps = X_list[0].shape[0]\n",
    "N_chains = len(X_list)\n",
    "print (\"Number of steps: %i\"%(N_steps))\n",
    "print (\"Number of chains: %i\"%(N_chains))\n",
    "\n",
    "## Join all the variables\n",
    "X_all = np.concatenate((X_list), axis = 0)\n",
    "Y_all = np.concatenate((Y_list), axis = 0)\n",
    "\n",
    "print ([\"Shape of the concatenated data:\",X_all.shape ]):\n",
    "    \n",
    "\n",
    "def get_All_datapoints(folder_data = \"./artificial_data/\", Ndivisions = 10):\n",
    "    X_list = pkl.load_pickle(folder_data +\"X_values.pkl\",Ndivisions)\n",
    "    Y_list = pkl.load_pickle(folder_data +\"Y_values.pkl\",Ndivisions)\n",
    "    X_all = np.concatenate((X_list), axis = 0)\n",
    "    Y_all = np.concatenate((Y_list), axis = 0)\n",
    "    \n",
    "    return X_all, Y_all"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python [default]",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
